package cn.kxx.serviceImpl;

import cn.kxx.exception.BusinessException;
import cn.kxx.mapper.UserMapper;
import cn.kxx.pojo.User;
import cn.kxx.service.UserService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper mapper;

    /**
     * 找到用户名进行校验
     *
     * @param s 年代
     * @return {@link User}
     * @throws BusinessException 业务异常
     */
    @Override

    public User findByUsername(String s) throws BusinessException {
        User user = mapper.getUserAndRolesAndPermsByUserName(s);
        System.out.println(user);
        return user;
    }
}
